package com.dandelion.common.dao.auto.mapper;

import com.dandelion.common.dao.auto.pojo.CustomService;
import com.dandelion.common.dao.auto.pojo.CustomServiceCriteria;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface CustomServiceMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @SelectProvider(type=CustomServiceSqlProvider.class, method="countByExample")
    long countByExample(CustomServiceCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @DeleteProvider(type=CustomServiceSqlProvider.class, method="deleteByExample")
    int deleteByExample(CustomServiceCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Delete({
        "delete from t_custom_service",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Insert({
        "insert into t_custom_service (name, show_bld_lift, ",
        "description, is_deleted, ",
        "create_time, update_time)",
        "values (#{name,jdbcType=VARCHAR}, #{showBldLift,jdbcType=TINYINT}, ",
        "#{description,jdbcType=VARCHAR}, #{isDeleted,jdbcType=TINYINT}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(CustomService record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @InsertProvider(type=CustomServiceSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(CustomService record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @SelectProvider(type=CustomServiceSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="show_bld_lift", property="showBldLift", jdbcType=JdbcType.TINYINT),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_deleted", property="isDeleted", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<CustomService> selectByExample(CustomServiceCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Select({
        "select",
        "id, name, show_bld_lift, description, is_deleted, create_time, update_time",
        "from t_custom_service",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="show_bld_lift", property="showBldLift", jdbcType=JdbcType.TINYINT),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_deleted", property="isDeleted", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    CustomService selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @UpdateProvider(type=CustomServiceSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CustomService record, @Param("example") CustomServiceCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @UpdateProvider(type=CustomServiceSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") CustomService record, @Param("example") CustomServiceCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @UpdateProvider(type=CustomServiceSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CustomService record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_custom_service
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Update({
        "update t_custom_service",
        "set name = #{name,jdbcType=VARCHAR},",
          "show_bld_lift = #{showBldLift,jdbcType=TINYINT},",
          "description = #{description,jdbcType=VARCHAR},",
          "is_deleted = #{isDeleted,jdbcType=TINYINT},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(CustomService record);
}